<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>
        <input type="number">
        <button>发送</button>
    </div>
    <script>
        var btn = document.querySelector('button');
        var num = 3;
        var timer  = null;
        btn.addEventListener('click',function(){
            var timer
            timer = setInterval(function(){
                btn.disabled= true;
                if(num == 0 ){
                    btn.disabled = false;
                    setInterval(timer);
                    btn.innerHTML = '发送';
                    num = 3;
                }else{
                    btn.innerHTML = '还剩下'+num+'秒';
                    num--;
                }
            },1000)
        })
        
               
    </script>
</body>
</html>